Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Raw • View renderedDownload


docs/agents/conventions/tests.md 3f7ef731b5effd9aa3a81eceea66fd6c2b56498c (3f7ef731) Text, 2.08 KB

Tc9d1d9# Test conventions

Applies when editing Ta5d6ff`tests/**/*.{py,js}`.

Tff7b72- Backend: Ta5d6ff`tests/backend/test_*.py` with pytest + asyncio auto mode.
Tff7b72- Frontend: Ta5d6ff`tests/frontend/*.test.js` with vitest + Ta5d6ff`@vue/test-utils`.
Tff7b72- Mock Ta5d6ff`window.api` for page tests. Assert toasts when outcomes are user-visible.
Tff7b72- Prefer focused files over full suite unless the user asks for broad runs.
Tff7b72- Landlock tests that apply the sandbox must run in a subprocess (one restrict per process).
Tff7b72- Long-running / notification soak suites can hang. Prefer timeouts and avoid piping pytest through Ta5d6ff`tail` in agent shells.

Tc9d1d9## Oracle style (no soft fuzz)

Property and fuzz tests must assert an accept or reject outcome, not only that nothing crashed.

Refuse these patterns:

Tff7b72- Bare Ta5d6ff`except Exception: pass` around the code under test
Tff7b72- Ta5d6ff`never_raises` tests with no postcondition
Tff7b72- Asserting only that a result dict has an Ta5d6ff`"ok"` key without checking True or False
Tff7b72- Mocks that return the success path for every input under a security oracle

Prefer:

Tff7b72- Independent oracle: given input X, predict accept or reject, then assert the code matches
Tff7b72- Jail oracles: on success, resolved path stays under the allowed root
Tff7b72- Closed reason sets: on Ta5d6ff`ValueError`, the message is one of the known machine reasons
Tff7b72- Round-trip or shape invariants when the API is pure parsing

Full skill: Ta5d6ff`docs/agents/skills/test-oracles/SKILL.md`.
Path jail filesystem features: Ta5d6ff`docs/agents/skills/path-jail-local-fs/SKILL.md` and Ta5d6ff`docs/agents/conventions/path-jail.md`.
Exploratory bug hunting: Ta5d6ff`docs/agents/skills/exploratory-testing/SKILL.md`.

Tc9d1d9## Extended Edge Case Tester (EECT) and Live Validation (LV)

Tff7b72- EECT packs live under Ta5d6ff`tests/backend/eect/packs/` and use marker Ta5d6ff`eect`.
Tff7b72- LV ladder lives under Ta5d6ff`tests/backend/eect/live/` and uses marker Ta5d6ff`live_validation`.
Tff7b72- Replay a failure with Ta5d6ff`MESHCHAT_EECT_SEED=<seed>` (printed on assert failure).
Tff7b72- Commands: Ta5d6ff`task test:eect`, Ta5d6ff`task test:lv:l0`, Ta5d6ff`MESHCHAT_LIVE_VALIDATION=1 task test:lv`.
Tff7b72- LV L2/L3 are opt-in (Ta5d6ff`MESHCHAT_LIVE_VALIDATION=1` or Ta5d6ff`MESHCHAT_LIVE_RETICULUM=1`). L0/L1 stay CI-safe.


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────